trycount=0

for i in range(3):
    trycount+=1
    username=input("请输入用户名：")
    password=input("请输入密码：")

    if username=="admin":
        if password=="admin888":
            print("恭喜你，登录成功！")
            break
        else:
            print("密码错误")
            print(f"你还有{3-trycount}次机会")
    else:
        print("用户名错误")
        print(f"你还有{3-trycount}次机会")